package model.components.nodes.node.sdn;

import model.components.nodes.node.Node;
import model.components.nodes.node.virtual.VirtualNode;

public class SdnRouter extends SdnNode
{
	public SdnRouter( String networkName, int number, String os, int cpu, int ram, int maxVirtualNodesNumber )
	{
		super( networkName, /*SdnRouter.class.getSimpleName()*/"SdnNode", number, Node.ROUTER_TYPE, os, cpu, ram, maxVirtualNodesNumber, Node.GREY_ROUTER, Node.GREEN_ROUTER, Node.YELLOW_ROUTER, Node.RED_ROUTER );
	}
	
	@Override
	public SdnRouter getCopy()
	{		
		SdnRouter sdnRouter = new SdnRouter( this.getNetworkName(), this.getNumber(), this.getOS(), this.getCPU(), this.getRAM(), this.getAvailableVirtualNodesNumber() );
		sdnRouter.setInitialNumber( this.getInitialNumber() );
		sdnRouter.setNamePrefix( this.getNamePrefix() );
		sdnRouter.setType( this.getType() );
		sdnRouter.setAvailableCPU( this.getAvailableCPU() );
		sdnRouter.setAvailableRAM( this.getAvailableRAM() );
		sdnRouter.setMaxVirtualNodesNumber( this.getMaxVirtualNodesNumber() );
		sdnRouter.setTimeStamp( this.getTimeStamp() );
		sdnRouter.setSelected( this.isSelected() );
		sdnRouter.setIsController( this.isController() );
		
		for( VirtualNode virtualNode: this.getVirtualNodes() )
			sdnRouter.add( virtualNode.getCopy() );
		
		return sdnRouter;
	}
	
	public SdnRouter getSoftCopy()
	{		
		SdnRouter sdnRouter = new SdnRouter( this.getNetworkName(), this.getNumber(), this.getOS(), this.getCPU(), this.getRAM(), this.getAvailableVirtualNodesNumber() );
		sdnRouter.setInitialNumber( this.getInitialNumber() );
		sdnRouter.setNamePrefix( this.getNamePrefix() );
		sdnRouter.setType( this.getType() );
		sdnRouter.setAvailableCPU( this.getAvailableCPU() );
		sdnRouter.setAvailableRAM( this.getAvailableRAM() );
		sdnRouter.setMaxVirtualNodesNumber( this.getMaxVirtualNodesNumber() );
		sdnRouter.setTimeStamp( this.getTimeStamp() );
		sdnRouter.setSelected( this.isSelected() );
		
		return sdnRouter;
	}

}
